package com.dao.${packageName}; 

import com.model.${packageName}.${table_name}Model; 
import java.sql.SQLException;
import java.util.List; 
import java.util.Map; 
import org.apache.ibatis.annotations.Param; 
import org.springframework.stereotype.Repository;

@Repository("${packageName}${table_name}Dao")
public interface ${table_name}Dao  { 

	/**
	 * 新增
	 * 
	 * @author chenjun
	 * @date 2022/03/10
	 **/
	int insert(${table_name}Model ${nocapTableName}Model);

	
	<#list model_column as model>	
	<#if model.isPri == "1">
	int deleteBy${model.capColumnName}(String ${model.changeColumnName});
	
	List<${table_name}Model> selectBy${model.capColumnName}(String ${model.changeColumnName});
	</#if>
	</#list>
	
	/**
	 * 刪除
	 * 
	 * @author chenjun
	 * @date 2022/03/10
	 **/
	int delete(<#list model_pri as model>@Param("${model}")String ${model}<#if model_has_next>,</#if></#list>);

	/**
	 * 更新
	 * 
	 * @author chenjun
	 * @date 2022/03/10
	 **/
	int update(${table_name}Model ${nocapTableName}Model);

	/**
	 * 查询 根据主键 id 查询
	 * 
	 * @author chenjun
	 * @date 2022/03/10
	 **/
	${table_name}Model load(<#list model_pri as model>@Param("${model}")String ${model}<#if model_has_next>,</#if></#list>);


	// 列表
	List<${table_name}Model> selectList(Map<String, Object> map);

	// 列表总数
	int selectListCount(Map<String, Object> map);
 }